package me.wenlong.roomdemo.database

import android.arch.persistence.room.Entity
import android.arch.persistence.room.ForeignKey
import android.arch.persistence.room.PrimaryKey

/**
 *
 * 类的描述
 *
 * @author guowenlong
 * 创建时间:2018-11-11-下午10:56
 *
 */

@Entity(
    foreignKeys = arrayOf(
        ForeignKey(
            entity = OrderEntity::class,
            parentColumns = arrayOf("orderId"),
            childColumns = arrayOf("orderId"),
            onUpdate = ForeignKey.CASCADE,
            onDelete = ForeignKey.CASCADE
        )
    )
)
class ImageEntity constructor(@PrimaryKey var id: Int, var orderId: String, var imageUrl: String){
    override fun toString(): String {
        return "ImageEntity(id=$id, orderId='$orderId', imageUrl='$imageUrl')"
    }
}